import 'package:flutter/cupertino.dart';
import 'package:flutter_project/config/theme_color.dart';

class EmptyImgView {
  static Widget commonEmptyImg({
    String? url,
    double imgWidth = 0,
    double imgHeight = 0,
    double radius = 0,
    String status='创作失败，请重新创作',
  }) {
    url ??= '';
    return url.isEmpty
        ? Container(
      color: ThemeColor.checkNormalColor,
            width: imgWidth,
            height: imgHeight,
            alignment: Alignment.center,
            child: Text(status,textAlign: TextAlign.center,),
          )
        : ClipRRect(
            borderRadius: BorderRadius.circular(radius),
            child: Image.network(
              url,
              width: imgWidth,
              height: imgHeight,
              fit: BoxFit.cover,
            ),
          );
  }
}
